import java.util.Arrays;

/**
 * @author JiuQi 玖柒
 * @date 2021/7/8 20:38
 * 翻转字符串
 */
public class T344 {
    public static void main(String[] args) {
        char[] s = {'h', 'e', 'l', 'l', 'o'};
        new Solution344().reverseString(s);
    }
}

class Solution344 {
    public void reverseString(char[] s) {
        int n = s.length;
        int left = 0, right = n - 1;
        while (left <= right) {
            char temp = s[left];
            s[left] = s[right];
            s[right] = temp;
            left++;
            right--;
        }
        System.out.println(Arrays.toString(s));
    }
}
